//
//  ViewController.swift
//  Social
//
//  Created by 李响 on 2019/5/14.
//  Copyright © 2019 shengsheng. All rights reserved.
//

import UIKit

protocol CustomViewable: UIViewController {
    associatedtype Container
    var container: Container { get }
}

extension CustomViewable  {
    var container: Container {
        return view as! Container
    }
}

class ViewController<Container: UIView>: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .default
    }
    
    override var shouldAutorotate: Bool {
        return false
    }
    
    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        return .portrait
    }
    
    override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
        return .portrait
    }
    
    deinit { print("deinit:\t\(classForCoder)") }
}

extension ViewController: CustomViewable { }
